// 请求状态错误
export const httpLogError = (error) => {
	uni.showToast({
		title: error.message,
		icon: 'error',
		duration: 2000
	})
}

// api请求错误
export const requestError = (response) => {
	return new Promise((resolve, reject) => {
		const { data } = response
		const msg = `api请求出错 ${response.config.url}：${data.msg}`
		uni.showToast({
			title: msg,
			icon: 'error',
			duration: 2000
		})
		reject(data)
	})
}

// 登录失效 打开弹窗
export const throttleToLogin = () => {
	uni.navigateTo({
		url: '/pages/login/index'
	})
}